import request from '@/utils/request';

//查询树形结构
export async function findAll() {
  return request('/api/menu', {
    method: 'GET',
  });
}
//查询单个菜单
export async function findOne(id) {
  return request('/api/menu/' + id, {
    method: 'GET',
  });
}
//创建菜单
export async function Create(data){
  return request('/api/menu',{
    method:'POST',
    body:data,
  })
}
//更新菜单
export async function Update(data){
  return request('/api/menu/'+data.id,{
    method:'PUT',
    body:data
  })
}
//删除菜单
export async function Delete(id){
  return request('/api/menu/'+id,{
    method:'DELETE',
  })
}
